package com.rc.saas.tenant.service.discount;

import com.github.pagehelper.PageInfo;
import com.rc.saas.tenant.base.BaseService;
import com.rc.saas.tenant.common.vo.TResponse;
import com.rc.saas.tenant.mapper.discount.TenantDiscountPolicyMapper;
import com.rc.saas.tenant.model.discount.TenantDiscountPolicy;
import com.rc.saas.tenant.model.discount.TenantDiscountPolicyExample;
import com.rc.saas.tenant.base.BaseSearch;
import com.rc.saas.tenant.vo.discount.EnterpriseDiscountResultVo;

import java.util.List;

/**
 * @author frog
 * @date 2019/11/25
 */
public interface TenantDiscountPolicyService extends BaseService<Long, TenantDiscountPolicy, TenantDiscountPolicyExample, TenantDiscountPolicyMapper> {
    PageInfo<TenantDiscountPolicy> searchByCondition(BaseSearch baseSearch, Long elecStationId);

    /**
     * 保存成功返回主键值
     *
     * @param tenantDiscountPolicy
     * @return
     */
    Long insertReturnPrimaryKey(TenantDiscountPolicy tenantDiscountPolicy);

    TenantDiscountPolicy selectAllById(Long discountPolicyId);

    List<TenantDiscountPolicy> selectAllByStationId(Long elecStationId);

    /**
     * 查询是否有存在中的政策(自己本身除外)
     *
     * @param elecStationId
     * @return
     */
    TResponse isUsingPolicy(Long elecStationId, Long discountPolicyId);

    TResponse updateStatus(Long discountPolicyId);

    PageInfo<EnterpriseDiscountResultVo> listPageEnterpriseDiscount(BaseSearch baseSearch, Long enterpriseId);

    Long insertReturnKey(TenantDiscountPolicy tenantDiscountPolicy);

    TResponse deleteEnterpriseDiscountStation(Long discountStationId);
}
